package com.xiaozhu.task;

import com.xiaozhu.utils.RedisUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/**
 * @author 朱慧军
 * @version 1.0
 */
@Component
@Slf4j
public class RedisTask {

    @Autowired
    private RedisUtils redisUtils;

    @Scheduled(cron = "0 0 0 * * ?")
    public void clearRedis(){
        log.info(" 每天 0 点 0 分 0 清除redis缓存");
        redisUtils.delAll();
    }
}
